import { defineStore } from "pinia";
import { ref } from "vue";
// 全局设置
export const useSetupStore = defineStore(
  "setup",
  () => {
    const data = ref<{ speedBallShow: boolean }>({
      speedBallShow: false,
    });

    function init() {
      if (data.value.speedBallShow) {
        window.ipcRenderer.invoke("toggleSpeedBall", true);
      }
    }

    return { data, init };
  },

  {
    persist: true, // 配置持久化
  },
);
